<html lang="en">

<head th:include="templates/common :: header" />

<body>
	<div class="container" style="margin-top: 40px;">
		<div th:include="templates/common :: menu" ></div>	
		
		<div class="alert alert-success" th:if="${not #strings.isEmpty(status) and status == 'form.create.success'}">
			<a class="close">x</a>
			<p class="status" th:if="${not #strings.isEmpty(status)}" th:utext="#{${status}}">Status</p>
		</div>
		
		<div class="alert alert-danger" th:if="${not #strings.isEmpty(status) and status == 'form.create.failure'}">
			<a class="close">x</a>
			<p class="status" th:if="${not #strings.isEmpty(status)}" th:utext="#{${status}}">Status</p>
		</div>

		<div class="alert alert-success" th:if="${not #strings.isEmpty(status) and status == 'form.update.success'}">
			<a class="close">x</a>
			<p class="status" th:if="${not #strings.isEmpty(status)}" th:utext="#{${status}}">Status</p>
		</div>
		
		<div class="alert alert-danger" th:if="${not #strings.isEmpty(status) and status == 'form.update.failure'}">
			<a class="close">x</a>
			<p class="status" th:if="${not #strings.isEmpty(status)}" th:utext="#{${status}}">Status</p>
		</div>
		
		<div class="alert alert-success" th:if="${not #strings.isEmpty(status) and status == 'form.delete.success'}">
			<a class="close">x</a>
			<p class="status" th:if="${not #strings.isEmpty(status)}" th:utext="#{${status}}">Status</p>
		</div>	
		
		<div class="alert alert-danger" th:if="${not #strings.isEmpty(status) and status == 'form.delete.failure'}">
			<a class="close">x</a>
			<p class="status" th:if="${not #strings.isEmpty(status)}" th:utext="#{${status}}">Status</p>
		</div>	
		
		<div class="alert alert-danger" th:if="${not #strings.isEmpty(status) and status == 'form.not.found'}">
			<a class="close">x</a>
			<p class="status" th:if="${not #strings.isEmpty(status)}" th:utext="#{${status}}">Status</p>
		</div>
		
		<div class="alert alert-danger" th:if="${not #strings.isEmpty(status) and status == 'form.constraint.exception'}">
			<a class="close">x</a>
			<p class="status" th:if="${not #strings.isEmpty(status)}" th:utext="#{${status}}">Status</p>
		</div>
			
 		<div class="panel panel-primary" >		
	 		<div class="panel-body">				
				<div style="float:right; margin-bottom:10px;">
					<a class="btn btn-primary" th:href="@{/creditingform/create}" th:inline="text">
						<i class="glyphicon glyphicon-plus-sign" style="margin-right:5px;"/>[[#{form.create}]]
					</a>
				</div>			
			</div>
		</div>
			
		<table th:if="${not #lists.isEmpty(forms)}" class="table table-bordered table-striped table-condensed">
			<thead>
				<tr>
					<th scope="col" style="text-align: center !important;" th:text="#{form.label}"/>
					<th scope="col" style="text-align: center !important;"></th>
				</tr>
			</thead>
			<tbody>
				<tr th:each="form : ${forms}">
					<td th:text="${form.name}" style="text-align: center; vertical-align: middle;"></td>											
					<td style="text-align: center; vertical-align: middle;">					
						<a id="formEditLink" class="btn btn-primary btn-small" th:href="@{/creditingform/edit/__${form.id}__}" th:inline="text">
							<i class="glyphicon glyphicon-edit icon-white" style="margin-right:5px;"/>[[#{app.button.edit}]]
						</a>
						<a id="formDeleteLink" class="btn btn-danger btn-small" th:href="@{/creditingform/delete/__${form.id}__}"  th:inline="text" >
							<i class="glyphicon glyphicon-remove-sign" style="margin-right:5px;"/>[[#{app.button.delete}]]
						</a>
					</td>
				</tr>
			</tbody>
		</table>
	</div>		
</body>
</html>